//
//  BBGestureDecoder.h
//  BBTUIOTest
//
//  Created by ben smith on 24/09/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

typedef enum {
	BBSelectEventMask = 1,
	BBDragEventMask = 2,
	BBRotateEventMask = 4,
	BBScaleEventMask = 8
} BBCursorEventMask;


@class BBTUIOCursor;

@interface BBGestureDecoder : NSObject {
	NSMutableArray * oldCursors;
	NSMutableArray * newCursors;
	NSInteger eventMask;
	float scale;
	float angle;
	CGPoint vector;
	CGPoint centroid;
	NSEvent * mouseEvent;
	BOOL mouseDown;
	id delegate;
}

@property (retain) id delegate;
@property (retain) NSEvent * mouseEvent;
@property (assign) NSInteger eventMask;
@property (assign) float angle;
@property (assign) float scale;
@property (assign) CGPoint vector;
@property (assign) CGPoint centroid;

- (BBTUIOCursor*)matchingCursor:(BBTUIOCursor*)newCursor;
- (float)angleOfPoint:(NSPoint)p around:(NSPoint)center;
- (float)distanceFromPoint:(NSPoint)p to:(NSPoint)center;
- (id) init;
- (void)addCursor:(BBTUIOCursor*)aCursor;
- (void)addMouseDownEvent:(NSEvent*)theEvent;
- (void)addMouseDraggedEvent:(NSEvent*)theEvent;
- (void)addMouseUpEvent:(NSEvent*)theEvent;
- (void)decodeGestures;
- (void)finishCursorCycle;
- (void)handleDoubleTouch;
- (void)handleSingleTouch;

// 12 methods


@end
